#!/usr/bin/env python3
# -*- coding: utf-8 -*-

def my_abs(x):
    if x >= 0:
        return x
    else:
        return -x


print(my_abs(-10))


# 空函数
def nop():
    pass


age = 20
if age >= 18:
    pass


# 参数检查 isinstance-数据类型检查
def my_abs(x):
    if not isinstance(x, (int, float)):
        raise TypeError('bad operand type')
    if x >= 0:
        return x
    else:
        return -x


import math


# 返回值是一个tuple
def move(x, y, step, angle=0):
    nx = x + step * math.cos(angle)
    ny = y - step * math.sin(angle)
    return nx, ny


x, y = move(100, 100, 60, math.pi / 6)
print(x, y)
